/**
 * 
 */
package qy.jalgotrade.broker;

/**
 * <pre>
 * Base class for market orders.
 * 
 * .. note::
 * 
 *     This is a base class and should not be used directly.
 * </pre>
 * 
 * @author c-geo
 *
 */
public abstract class MarketOrder extends Order {

	private boolean __onClose;

	/**
	 * @param type
	 * @param action
	 * @param instrument
	 * @param quantity
	 * @param instrumentTraits
	 * @throws Exception
	 */
	public MarketOrder(Action action, String instrument, double quantity, boolean onClose,
                       InstrumentTraits instrumentTraits) throws Exception {

		super(Type.MARKET, action, instrument, quantity, instrumentTraits);
		__onClose = onClose;
	}

	/**
	 * Returns True if the order should be filled as close to the closing price as possible
	 * (Market-On-Close order).
	 * 
	 * @return
	 */
	public boolean getFillOnClose() {

		return __onClose;
	}
}
